package com.weixue.dao;

import com.weixue.entity.NongFuMallGoods;
import com.weixue.entity.StockNumDTO;
import com.weixue.utils.PageQueryUtil;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Day29
 * Day35
 *      商品信息Mapper接口
 *      商品搜索Mapper接口
 */
public interface NongFuMallGoodsMapper {
    int deleteByPrimaryKey(Long goodsId);

    int insert(NongFuMallGoods record);

    /**
     * 1.保存一条新纪录
     */
    int insertSelective(NongFuMallGoods record);

    /**
     * Day30
     * 2.根据主键id获取记录
     */
    NongFuMallGoods selectByPrimaryKey(Long goodsId);

    /**
     * Day30
     * 3.修改一条记录
     */
    int updateByPrimaryKeySelective(NongFuMallGoods record);

    /**
     * Day30
     * 4.查询分页数据
     */
    List<NongFuMallGoods> findNongFuMallGoodsList(PageQueryUtil pageUtil);

    /**
     * Day30
     * 5.查询总数
     */
    int getTotalNongFuMallGoods(PageQueryUtil pageUtil);

    /**
     * Day30
     * 6.批量修改记录
     */
    int batchUpdateSellStatus(@Param("orderIds")Long[] orderIds,@Param("sellStatus") int sellStatus);

    int updateByPrimaryKeyWithBLOBs(NongFuMallGoods record);

    int updateByPrimaryKey(NongFuMallGoods record);

    List<NongFuMallGoods> selectByPrimaryKeys(List<Long> goodsIds);

    /**
     * Day35
     * 1.根据搜索字段查询分页数据
     */
    List<NongFuMallGoods> findNongFuMallGoodsListBySearch(PageQueryUtil pageUtil);

    /**
     * Day35
     * 2.根据搜索字段查询总数
     */
    int getTotalNongFuMallGoodsBySearch(PageQueryUtil pageUtil);

    int batchInsert(@Param("nongFuMallGoodsList") List<NongFuMallGoods> nongFuMallGoodsList);

    int updateStockNum(@Param("stockNumDTOS") List<StockNumDTO> stockNumDTOS);



}